package com.wenlin.page.controller;


import com.github.pagehelper.PageInfo;
import com.wenlin.page.response.Message;
import com.wenlin.page.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/***
 *  Created with IntelliJ IDEA.
 *  User:  wenlin
 *  Date:  2017/11/23
 *  Time:  16:03
 *  Description:分页controller
 **/
@RestController
@RequestMapping("/user/base")
public class UserController {
    static Logger logger = LoggerFactory.getLogger(UserController.class);
    @Autowired
    private UserService userService;

    /***
     *  User:  wenlin
     *  Date:  2017/12/5
     *  Time:  14:20
     *  Description:分页查询
     *  @param pageNum 页数
     *  @param pageSize 每页条数
     *  @return message
     **/
    @GetMapping("info")
    public Message<PageInfo> getUser(Integer pageNum, Integer pageSize){
        return userService.selectPage(pageNum,pageSize);
    }

}
